package com.zhongwang.business.module.basic.service;

import com.zhongwang.business.module.basic.dao.BusinessGroupDao;
import com.zhongwang.business.module.basic.model.BusinessGroupModel;
import com.zhongwang.business.module.basic.model.DictEnumModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusinessGroupService {
    @Autowired
    private BusinessGroupDao businessGroupDao;

    /**
     * 查找不同的项目组
     * @param model
     * @return
     */
    public List<BusinessGroupModel> selectBusinessGroupList(BusinessGroupModel model){
        return businessGroupDao.selectBusinessGroupList(model);
    }

    public List<DictEnumModel>  selectUserList(){
        return businessGroupDao.DictEnumList();
    }


    /**
     * 查找全部的组信息
     * @return
     */
    public List<BusinessGroupModel> selectAllGroupList(){
        return businessGroupDao.selectAllGroupList();
    }

    /**
     * 添加
     * @param model
     * @return
     */
    public int addGroupInfo(BusinessGroupModel model)
    {
        return businessGroupDao.addGroupInfo(model);
    }

    /**
     * 修改
     * @param model
     * @return
     */
    public int updGroupInfo(BusinessGroupModel model){
        return businessGroupDao.updGroupInfo(model);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    public int delGroupInfo(Integer id){
        return businessGroupDao.delGroupInfo(id);
    }

    /**
     * 查询一条数据的方法
     * @param id
     * @return
     */
    public BusinessGroupModel selectAllGroupById(Integer id){
        return businessGroupDao.selectAllGroupById(id);
    }

    public List<BusinessGroupModel> selectDept() {
        return  businessGroupDao.selectDept();
    }
}
